package com.ll.domain.ranking.convert;

import com.baomidou.mybatisplus.extension.api.R;
import com.ll.app.api.req.AddRankingReqDTO;
import com.ll.dal.po.RankingPO;
import com.ll.domain.ranking.dto.RankingDTO;
import com.ll.domain.ranking.enums.RankingStatusEnum;
import org.springframework.beans.BeanUtils;

import java.util.Date;

public class RankingConvert {
    private static final Long  DEFAULT_TENANT_ID = 1L;

    public static RankingDTO PO2DTO(RankingPO po) {
        RankingDTO dto  = new RankingDTO();
        BeanUtils.copyProperties(po, dto);
        return dto;
    }

    public static RankingPO addRankingReqDTO2PO(AddRankingReqDTO dto){
        RankingPO po = new RankingPO();
        BeanUtils.copyProperties(dto, po);
        po.setStatus(RankingStatusEnum.未认证);
        po.setCtime(new Date());
        po.setUtime(new Date());
        return po;
    }


}
